home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / SMP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-17  |  1.5 KB  |  80 lines

  1. #ifndef __LINUX_SMP_H
  2. #define __LINUX_SMP_H
  3.  
  4. /*
  5.  *    Generic SMP support
  6.  *        Alan Cox. <alan@cymru.net>
  7.  */
  8.  
  9. #ifdef __SMP__
  10.  
  11. #include <asm/smp.h>
  12.  
  13. /*
  14.  * main cross-CPU interfaces, handles INIT, TLB flush, STOP, etc.
  15.  * (defined in asm header):
  16.  */ 
  17.  
  18. /*
  19.  * stops all CPUs but the current one:
  20.  */
  21. extern void smp_send_stop(void);
  22.  
  23. /*
  24.  * sends a 'reschedule' event to another CPU:
  25.  */
  26. extern void FASTCALL(smp_send_reschedule(int cpu));
  27.  
  28.  
  29. /*
  30.  * Boot processor call to load the other CPU's
  31.  */
  32. extern void smp_boot_cpus(void);
  33.  
  34. /*
  35.  * Processor call in. Must hold processors until ..
  36.  */
  37. extern void smp_callin(void);
  38.  
  39. /*
  40.  * Multiprocessors may now schedule
  41.  */
  42. extern void smp_commence(void);
  43.  
  44. /*
  45.  * True once the per process idle is forked
  46.  */
  47. extern int smp_threads_ready;
  48.  
  49. extern int smp_num_cpus;
  50.  
  51. extern volatile unsigned long smp_msg_data;
  52. extern volatile int smp_src_cpu;
  53. extern volatile int smp_msg_id;
  54.  
  55. #define MSG_ALL_BUT_SELF    0x8000    /* Assume <32768 CPU's */
  56. #define MSG_ALL            0x8001
  57.  
  58. #define MSG_INVALIDATE_TLB    0x0001    /* Remote processor TLB invalidate */
  59. #define MSG_STOP_CPU        0x0002    /* Sent to shut down slave CPU's
  60.                      * when rebooting
  61.                      */
  62. #define MSG_RESCHEDULE        0x0003    /* Reschedule request from master CPU*/
  63. #define MSG_MTRR_CHANGE         0x0004  /* Change MTRR */
  64.  
  65. #else
  66.  
  67. /*
  68.  *    These macros fold the SMP functionality into a single CPU system
  69.  */
  70.  
  71. #define smp_num_cpus            1
  72. #define smp_processor_id()        0
  73. #define hard_smp_processor_id()        0
  74. #define smp_threads_ready        1
  75. #define kernel_lock()
  76. #define cpu_logical_map(cpu)        0
  77.  
  78. #endif
  79. #endif
  80.